package david.java.flink_sql.udf;

import org.apache.flink.table.functions.ScalarFunction;

/**
 * @Description:
 * @Author: David
 * @Date: Create in 4:32 下午 2022/1/19
 */
public class Array2String extends ScalarFunction {


    public String eval(String separator, String[] array) {
        if (array == null || array.length == 0) {
            return null;
        }

        return String.join(separator, array);
    }

    // public String eval(String separator, List<String> array) {
    //     if (array == null || array.size() == 0) {
    //         return null;
    //     }
    //     return String.join(separator, array);
    // }
    //


    public static void main(String[] args) {
        Array2String merge = new Array2String();
    }
}
